/*
 * @Descripttion: 
 * @version: 
 * @Author: kk
 * @Date: 2020-10-23 16:36:33
 * @LastEditors: kk
 * @LastEditTime: 2020-10-23 21:53:37
 */
import request from '@/utils/request'

export default{

    //获取所有商品
    getItems(){
        return request({
            url: `/item/getItems`,
            method: 'get'
        })
    },
    //获取分页商品列表
    getItemList(page,limit,itemQuery){
        return request(
            {
                url:`/item/getItemList/${page}/${limit}`,
                method: 'post',
                data: itemQuery
            }
        )
    },
    //删除商品
    removeItem(id){
        return request({
            url: `/item/removeItem/${id}`,
            method:'post'
        })
    },
    //获取对应商品
    getItem(id){
        return request({
            url: `/item/getItem/${id}`,
            method: 'get'
        })
    },
    //添加商品
    addItem(item){
        return request({
            url: `/item/addItem`,
            method: 'post',
            data: item
        })
    },
    //修改商品
    updateItem(item){
        return request({
            url: `/item/updateItem`,
            method: 'post',
            data: item
        })
    },

}